import { createSSRApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'

export function createApp() {
  const app = createSSRApp(App)

  // 配置 Pinia
  const pinia = createPinia()
  app.use(pinia)

  // 全局属性配置
  app.config.globalProperties.$api = '/api'

  return {
    app,
    pinia
  }
}